package java67_adv8.bank;

public class Depositer extends Thread {
	private Account ac;

	public Depositer(Account a, String name) {
		super(name);
		this.ac = a;
	}

	@Override
	public void run() {
		while (true) {
			ac.deposit(3000);
			System.out.println(super.getName() + "存钱3000元，现在余额是：" + ac.getMoney());
			try {
				synchronized (ac) {
					ac.notifyAll();
				}

				Thread.sleep(4000);
			} catch (InterruptedException e) {
				// TODO 自动生成的 catch 块
				e.printStackTrace();
			}
		}
	}
}
